package common.statusenum;

import java.util.HashMap;

/**
 * 合同计费枚举
 *
 * @author yuanqinglong
 * @since 2020/9/8 9:50
 */
public enum ChargeEnum {
    /**
     * 计费方式：1=查询 2=查得 3=包企业数
     */
    QUERY(ChargeEnum.QUERY_CODE, "查询"),
    FIND_OUT(ChargeEnum.FIND_OUT_CODE, "查得"),
    ENTERPRISE_BILLING(ChargeEnum.ENTERPRISE_BILLING_CODE, "包企业数计费");

    public static final String QUERY_CODE = "1";
    public static final String FIND_OUT_CODE = "2";
    public static final String ENTERPRISE_BILLING_CODE = "3";

    private final String code;
    private final String msg;

    ChargeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public String getCode() {
        return this.code;
    }


    public String getMsg() {
        return this.msg;
    }

    static HashMap<String, String> map = new HashMap(32);

    static {
        for (ChargeEnum value : ChargeEnum.values()) {
            map.put(value.code, value.msg);
        }
    }

    public static String getMsgByCode(String code) {
        return map.get(code);
    }

}
